<%@ page contentType="text/html;charset=utf-8"%>   
<%@ page import="java.sql.*"%> 
<html>   
<body>   
<%Class.forName("com.mysql.jdbc.Driver").newInstance();   
String url ="jdbc:mysql://localhost/csoeibbs?user=root&password=666666&useUnicode=true&characterEncoding=UTF-8";
//testDB为你的数据库名 
Connection conn= DriverManager.getConnection(url);   
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);   
String sql="select * from test";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()) {%>
您的第一个字段内容为：<%=rs.getString(1)%>
您的第二个字段内容为：<%=rs.getString(2)%>
<%}%>
<%out.print("");%>
<%rs.close();   
stmt.close();   
conn.close();   
%>   
</body>   
</html>